import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { StatusBar } from 'react-native';
import { ThemeProvider } from '@rneui/themed';

// Import screens
import WelcomeScreen from '@screens/WelcomeScreen';
import LandingScreen from '@screens/LandingScreen';
import LoginScreen from '@screens/LoginScreen';
import RegisterScreen from '@screens/RegisterScreen';
import ForgotPasswordScreen from '@screens/ForgotPasswordScreen';
import IdentityVerificationScreen from '@screens/IdentityVerificationScreen';
import DocumentScanScreen from '@screens/DocumentScanScreen';
import UserInfoCollectionScreen from '@screens/UserInfoCollectionScreen';
import HomeScreen from '@screens/HomeScreen';
import PortfolioScreen from '@screens/PortfolioScreen';
import QRDepositScreen from '@screens/QRDepositScreen';
import TransactionHistoryScreen from '@screens/TransactionHistoryScreen';
import SettingsScreen from '@screens/SettingsScreen';
import SecuritySettingsScreen from '@screens/SecuritySettingsScreen';
import ProfileScreen from '@screens/ProfileScreen';
import MainTabNavigator from '@navigation/MainTabNavigator';

const Stack = createStackNavigator();

const App = () => {
  return (
    <SafeAreaProvider>
      <ThemeProvider>
        <NavigationContainer>
          <StatusBar barStyle="light-content" backgroundColor="#1a1a2e" />
          <Stack.Navigator
            initialRouteName="Welcome"
            screenOptions={{
              headerStyle: {
                backgroundColor: '#1a1a2e',
              },
              headerTintColor: '#fff',
              headerTitleStyle: {
                fontWeight: 'bold',
              },
            }}
          >
            <Stack.Screen name="Welcome" component={WelcomeScreen} options={{ headerShown: false }} />
            <Stack.Screen name="Landing" component={LandingScreen} options={{ headerShown: false }} />
            <Stack.Screen name="Login" component={LoginScreen} options={{ title: '登录' }} />
            <Stack.Screen name="Register" component={RegisterScreen} options={{ title: '注册' }} />
            <Stack.Screen name="ForgotPassword" component={ForgotPasswordScreen} options={{ title: '忘记密码' }} />
            <Stack.Screen name="IdentityVerification" component={IdentityVerificationScreen} options={{ title: '身份验证' }} />
            <Stack.Screen name="DocumentScan" component={DocumentScanScreen} options={{ title: '证件扫描' }} />
            <Stack.Screen name="UserInfoCollection" component={UserInfoCollectionScreen} options={{ title: '信息收集' }} />
            <Stack.Screen name="Main" component={MainTabNavigator} options={{ headerShown: false }} />
            <Stack.Screen name="Portfolio" component={PortfolioScreen} options={{ title: '投资组合' }} />
            <Stack.Screen name="QRDeposit" component={QRDepositScreen} options={{ title: '二维码存款' }} />
            <Stack.Screen name="TransactionHistory" component={TransactionHistoryScreen} options={{ title: '交易记录' }} />
            <Stack.Screen name="Settings" component={SettingsScreen} options={{ title: '设置' }} />
            <Stack.Screen name="SecuritySettings" component={SecuritySettingsScreen} options={{ title: '安全设置' }} />
            <Stack.Screen name="Profile" component={ProfileScreen} options={{ title: '个人资料' }} />
          </Stack.Navigator>
        </NavigationContainer>
      </ThemeProvider>
    </SafeAreaProvider>
  );
};

export default App;
